package net.pinnoocle.playadminpc.task;

import lombok.extern.slf4j.Slf4j;
import net.pinnoocle.playservice.service.impl.CouponServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


/**
 * @author ye
 * @Description
 * @create 2021-09-16 14:57
 */
@Component
@Slf4j
public class ChangeUserCouponStatusTask {

    @Autowired
    CouponServiceImpl couponService;

    @Scheduled(cron="1 0,24 * * * ?")
    public void changeCouponStatusTask(){
        try {
            couponService.changeUserCoupon();
        } catch (Exception e) {
           log.info("changeCouponStatusTask==="+e.getMessage());
        }
    }
}
